<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<title>Insert title here</title>
	</head>
	<body>
		<ui:composition template="/view/templates/layout.xhtml">
			<ui:define name="content">
				<p>
					<h:link value="#{appResources['label.link.News']}" outcome="newsList" />
					&gt;&gt;
					#{appResources['label.addnews.title']}<br/>
				</p>
				<h:form id="add-news-form" onsubmit="return validateNewsForm(clicked);">
					<p class="news-label"> 
						<h:outputText value="#{appResources['label.addnews.newstitle']}" />	
					</p>
					<p class="news-content">
						<h:inputText styleClass="add-news-content" id="add-news-title" value="#{newsBean.currentNews.title}" />
					</p>
					<p class="news-label">
						<h:outputText value="#{appResources['label.addnews.newsdate']}" />	
					</p>
					<p class="news-content">
						<h:inputText styleClass="add-news-content" id="add-news-date" value="#{newsBean.currentNews.date}">
							<f:convertDateTime pattern="#{appResources['format.date']}" />
						</h:inputText>
					</p>
					<p class="news-label">
						<h:outputText value="#{appResources['label.addnews.brief']}"/>
					</p>
					<p class="news-content">
						<h:inputTextarea styleClass="add-news-content" id="news-brief" rows="6" value="#{newsBean.currentNews.brief}" />
					</p>
					<p class="news-label">
						<h:outputText value="#{appResources['label.addnews.content']}"/>
					</p>
					<p class="news-content">
						<h:inputTextarea styleClass="add-news-content" id="news-content" rows="12" value="#{newsBean.currentNews.content}" />
					</p>
					<p id="add-news-buttons">
						<h:commandButton styleClass="add-news-button" action="#{newsBean.save}" onclick="clicked = 'save'" value="#{appResources['label.addnews.button.save']}" />
						<h:commandButton styleClass="add-news-button" action="#{newsBean.cancel}" onclick="clicked ='cancel'"  value="#{appResources['label.addnews.button.cancel']}" />
					</p>
				</h:form>
			</ui:define>
		</ui:composition>
	</body>
</html>